package com.smh.a06ThreadDemo6;

public class ThreadMethod2 {
    public static void main(String[] args) {

        MyThread1 myThread1 = new MyThread1();
        MyThread2 myThread2 = new MyThread2();

        myThread1.setName("女神");
        myThread2.setName("备胎");

        //备胎线程会等女神结束后就会陆陆续续结束,不是立刻结束.
        myThread2.setDaemon(true);

        myThread1.start();
        myThread2.start();


    }
}
